<?php

/**
 * A key set contains integer and/or string values, without duplicates or ordering. Adding a value already in the set does not modify the set.
 * 
 * A key set cannot contain non-integer, non-string items.
 */
class CKeySet implements ICSet {
	private $set = array();
	
	public function add($value) {
		$this->set[$value] = $value;
		return $this;
	}
	
	public function remove($value) {
		if (isset($this->set[$value]))
			unset($this->set[$value]);
		return $this;
	}
	
	public function contains($value) {
		return isset($this->set[$value]);
	}
	
	public function allItems() {
		return array_keys($this->set);
	}
}

?>